#!/bin/sh
#
# $NetBSD$
# $Id: passwd 88 2006-08-25 14:55:03Z seklecki $
#

# PROVIDE: passwd
# REQUIRE: mountcritremote
# BEFORE: SERVERS
# KEYWORD: shutdown

$_rc_subr_loaded . /etc/rc.subr

name="passwd"
start_cmd="passwd_start"
stop_cmd="passwd_stop"

passwd_start()
{
        echo "Updating secure password database against CF symlink."
        pwd_mkdb /etc/master.passwd
}

passwd_stop()
{
        echo "Archiving run-time passwd database onto CF media."
        cp -fvp /etc/master.passwd /shadow/etc/master.passwd
}

$_rc_subr_loaded . /etc/rc.subr

rcvar="update_passwd"
load_rc_config $name
run_rc_command "$1"
